package com.example.test.主方法运行测试;

import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;

import java.util.Date;

public class time {
    public static void main(String[] args) {

        System.out.println(DateUtil.beginOfDay(new Date()));


        DateTime dateTime = DateUtil.parseDate("2021-08-15 17:21:18");
        DateTime endDate = DateUtil.beginOfDay(dateTime);
        System.out.println(endDate);
        System.out.println(DateUtil.between(DateUtil.beginOfDay(new Date()), endDate, DateUnit.DAY));

    }
}
